import React from 'react';

import '../../static/brief/index.styl'


import {Icon} from 'antd';

import {connect} from 'react-redux'

import {temchange} from '../../actions/brief'

@connect(
  state => state.birefresult,
  {temchange}
)
export default class Brief extends React.Component {
  constructor(props) {
    super(props)
    this.state = {}
  }

  handlecahnge(index) {
    this.props.temchange(index)

  }

  render() {
    let templates = [{
      title: '网宣版',
      desc: '适合各地网宣部简报模板'
    }, {
      title: '党政版',
      desc: '五角星报头,适合政府及单位的简报模板'
    }, {
      title: '摘要版',
      desc: '纯信息展示,只阅读重点信息的简报模板'
    }, {
      title: '经典版',
      desc: '默认推荐的简报模板'
    },]
    return (
      <div className="items">
        {
          templates.map((template, index) => {
            return <div key={index} className={this.props.temno === index ? "item active" : "item"}
                        onClick={() => this.handlecahnge(index)}>
              <div className="title">{template.title}</div>
              <div className="time">2018年02月25日 17:31</div>
              <div className="doc"><Icon type="file" style={{fontSize: '36px', color: '#007be2'}}/></div>
              <div className="desc">{template.desc}</div>
            </div>
          })
        }
      </div>
    );
  }
}